package pers.cj.pdos.service;

import com.baomidou.mybatisplus.extension.service.IService;
import pers.cj.pdos.entity.InGoodsRefundAnalysis;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author chenj
 * @since 2020-03-25
 */
public interface IInGoodsRefundAnalysisService extends IService<InGoodsRefundAnalysis> {
    Map getTotalData(String companyId,
                     String storeId,
                     String houseId,
                     Date date1,
                     Date date2);

    List<InGoodsRefundAnalysis> listStoreData(String companyId, Integer page, Integer limit, String storeId, String houseId, Date date1, Date date2);

    List<InGoodsRefundAnalysis> listHouseData(String companyId, Integer page, Integer limit, String storeId, String houseId, Date date1, Date date2);

    List<InGoodsRefundAnalysis> listGoodsData(String companyId,
                                                   Integer page,
                                                   Integer limit,
                                                   String storeId,
                                                   String houseId,
                                                   String providerId,
                                                   Date date1,
                                                   Date date2,
                                                   String typeId,
                                                   Boolean filterZero,
                                                   String search);
    Long countGoodsData(String companyId,
                        String storeId,
                        String houseId,
                        String providerId,
                        Date date1,
                        Date date2,
                        String typeId,
                        Boolean filterZero,
                        String search);

    List<InGoodsRefundAnalysis> listProviderData(String companyId,
                                                   Integer page,
                                                   Integer limit,
                                                   String storeId,
                                                   String houseId,
                                                   Date date1,
                                                   Date date2,
                                                   String providerTypeId,
                                                   Boolean filterZero,
                                                   String search);
    Long countProviderData(String companyId,
                           String storeId,
                           String houseId,
                           Date date1,
                           Date date2,
                           String providerTypeId,
                           Boolean filterZero,
                           String search);

    BigDecimal getTotalProvider(String companyId,
                                String storeId,
                                String houseId,
                                Date date1,
                                Date date2,
                                String providerTypeId,
                                Boolean filterZero,
                                String search);

    List<InGoodsRefundAnalysis> listOrderData(String companyId,
                                                   Integer page,
                                                   Integer limit,
                                                   String storeId,
                                                   String houseId,
                                                   Date date1,
                                                   Date date2);
    Long countOrderData(String companyId,
                        String storeId,
                        String houseId,
                        Date date1,
                        Date date2);


    Map getHighGoods(String companyId, String storeId, String houseId, Date date1, Date date2);

    Map getHighProvider(String companyId, String storeId, String houseId, Date date1, Date date2);

    List<InGoodsRefundAnalysis> listGoodsDetailDataByOrder(String companyId,
                                                                           String goodsId,
                                                                           Integer page,
                                                                           Integer limit,
                                                                           String storeId,
                                                                           String houseId,
                                                                           Date date1,
                                                                           Date date2,
                                                                           String search);
    Long countGoodsDetailDataByOrder(String companyId,
                                     String goodsId,
                                     String storeId,
                                     String houseId,
                                     Date date1,
                                     Date date2,
                                     String search);

    List<InGoodsRefundAnalysis> listGoodsDetailDataByProvider(String companyId,
                                                                                 String goodsId,
                                                                                 Integer page,
                                                                                 Integer limit,
                                                                                 String storeId,
                                                                                 String houseId,
                                                                                 Date date1,
                                                                                 Date date2,
                                                                                 String search);
    Long countGoodsDetailDataByProvider(String companyId,
                                        String goodsId,
                                        String storeId,
                                        String houseId,
                                        Date date1,
                                        Date date2,
                                        String search);

    Map getMaxMinDate(String companyId, String goodsId, String providerId, String storeId, String houseId);

    /**
     * 按照年份获取销售额
     * @param companyId
     * @param goodsId
     * @param storeId
     * @param houseId
     * @param date1
     * @param date2
     * @return
     */
    List<Map> getTotalByYear(String companyId, String goodsId, String providerId, String storeId, String houseId, Date date1, Date date2);

    /**
     * 按照月份获取销售额
     * @param companyId
     * @param goodsId
     * @param storeId
     * @param houseId
     * @param date1
     * @param date2
     * @return
     */
    List<Map> getTotalByMonth(String companyId, String goodsId, String providerId, String storeId, String houseId, Date date1, Date date2);

    /**
     * 按照日获取销售额
     * @param companyId
     * @param goodsId
     * @param storeId
     * @param houseId
     * @param date1
     * @param date2
     * @return
     */
    List<Map> getTotalByDate(String companyId, String goodsId, String providerId, String storeId, String houseId, Date date1, Date date2);
}
